﻿Namespace GUI

    Public Structure MirItemDesc
        Dim imglib As Protocol.ImgLibs
        Dim img As Integer
        Dim alphacol As Color
    End Structure

    Namespace MouseDragItem

        Module mMouseDragItem

            Public MouseDragItemDesc As MirItemDesc
            Dim XOffset As Integer, YOffset As Integer
            Public CellXOffset As Integer, CellYOffset As Integer
            Dim mShow As Boolean
            Dim mReturnContainer As Object
            Dim bForceAddedItem As Boolean

            Public Sub SetMouseDragItem(ByRef desc As MirItemDesc, ByRef returncontainer As Object, ByRef xoff As Integer, ByRef yoff As Integer, ByRef cellxoff As Integer, ByRef cellyoff As Integer, Optional ByRef forceaddeditem As Boolean = False)

                MouseDragItemDesc = desc
                XOffset = xoff
                YOffset = yoff
                CellXOffset = cellxoff
                CellYOffset = cellyoff
                mReturnContainer = returncontainer
                mShow = True
                bForceAddedItem = forceaddeditem

            End Sub

            Public Sub RemoveMouseDragItem()

                mShow = False

            End Sub

            Public ReadOnly Property HasMouseDragItem()
                Get
                    Return mShow
                End Get
            End Property

            Public Sub DrawMouseDragItem(ByRef mode As DirectX.DrawingMode)

                If mShow Then

                    If mode = DirectX.DrawingMode.Normal Then
                        Libs.GetLib(MouseDragItemDesc.imglib).Image(MouseDragItemDesc.img).Draw(Mouse.XCoord - XOffset, Mouse.YCoord - YOffset, 0.01)
                    End If

                End If

            End Sub

        End Module

    End Namespace

End Namespace
